<?php
include('../Class/KhachHang_Class.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Thông tin khách hàng </title>
<head>
</head>

<body>
<form action="Add_KhachHang.php" method="post">
<div>Thông tin Khách Hàng</div>
<table style="width: 100%">
	<tr>
		<td style="width: 124px">Tên Khách Hàng</td>
		<td>
			<input name="tenkh" style="width: 236px" type="text" />
		</td>
	</tr>
	<tr>
		<td style="width: 124px">Địa chỉ</td>
		<td><input name="diachi" style="width: 236px" type="text" /></td>
	</tr>
	<tr>
		<td style="width: 124px; height: 26px;">Số điện thoại</td>
		<td style="height: 26px"><input name="sodt" style="width: 236px" type="text" /></td>
	</tr>
	<tr>
		<td style="width: 124px">Email</td>
		<td><input name="email" style="width: 236px" type="text" /></td>
	</tr>
	<tr>
		<td style="width: 124px">&nbsp;</td>
		<td>
			<input name="Submit" type="submit" value="Thêm" />
		</td>
	</tr>
</table>
</form>
<?php
if(isset($_POST['tenkh'])&&isset($_POST['diachi'])&&isset($_POST['sodt'])&&isset($_POST['email']))
{
$TenKH =$_POST['tenkh'];
$DiaChi=$_POST['diachi'];
$SoDT=$_POST['sodt'];
$Emai=$_POST['email'];
$khachhang=new KhachHang();
if($khachhang->Add_KhachHang($TenKH,$DiaChi,$SoDT,$Emai)<0)
{
	echo 'Thêm thất bại vui lòng kiểm tra lại!!'.@mysql_query($sql);
}
else
{
	echo 'Thêm thành công!!';
	header('location: Delete_KhachHang.php');
}
}
?>
</body>
</html>
